package com.cbw.service;

import com.cbw.dao.BaseAdminDao;
import com.cbw.dao.ImpI.BaseAdminDaoImpI;

import java.util.Date;

public class AdminService {
    private static BaseAdminDao dao = new BaseAdminDaoImpI();

    /**
     * 根据用户名更新管理员登录时间和登录ip
     * @param username
     * @param ip
     */
    public static void updateLoginTimeAndIp(String username, Date date, String ip){
        dao.updateLoginTime(username,date,ip);
    }

    /**
     * 登录
     * @param username
     * @param password
     * @return true表示登录成功
     */
    public static boolean login(String username,String password){
        return dao.login(username,password);
    }
}
